﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Yichat.MicroService.Interface
{
    public interface IDistributeionCache
    {
        Task<bool> ExistsAsync(string key, CancellationToken token = default);
        Task SetAsync<TValue>(string key, TValue value, TimeSpan? slidingExpiration = null, DateTimeOffset? absoluteExpiration = null, CancellationToken token = default);
        Task<TValue> GetAsync<TValue>(string key, TValue defaultValue=default, CancellationToken token = default);
        Task RemoveAsync<TValue>(string key, CancellationToken token = default);
    }
}
